#include "window.h"

Window::Window(QWidget * parent)
	: QDialog(parent)
{
	this->setWindowTitle("对话框展示"); // 设置窗口标题
    file_Btn =new QPushButton("标准文件对话框");
	connect(file_Btn, SIGNAL(clicked()), this, SLOT(showFileDialog()));
	color_Btn =new QPushButton("标准颜色对话框");
	connect(color_Btn, SIGNAL(clicked()), this, SLOT(showColorDialog()));
    font_Btn =new QPushButton("标准字体对话框");
    connect(font_Btn, SIGNAL(clicked()), this, SLOT(showFontDialog()));
    main_layout =new QGridLayout();        // 添加布局（网格布局）
    main_layout->addWidget(file_Btn,0,0);  // 添加组件
    main_layout->addWidget(color_Btn,0,1);
    main_layout->addWidget(font_Btn,1,0);
    setLayout(main_layout);        // 设置窗口布局
}
Window::~Window()
{
}
void Window::showFileDialog(){
	fileDialog =new FileDialog(this);
	fileDialog->show();
}
void Window::showColorDialog(){
	ColorDialog *colorDialog =new ColorDialog(this);
    colorDialog->show();
}
void Window::showFontDialog() {
    FontDialog *fontDialog =new FontDialog(this);
    fontDialog->show();
}